<%@ page contentType="text/html" pageEncoding="UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<div class="box">
  <h2>Détails de l'utilisateur <c:out value="${user.login}"/></h2>
  <div id="user-details" class="box-content">
    <div>
      <h3>Informations personnelles</h3>
      <p><span>Civilité :</span>
        <c:choose>
          <c:when test="${user.title == 0}">Monsieur</c:when>
          <c:when test="${user.title == 1}">Madame</c:when>
          <c:when test="${user.title == 2}">Mademoiselle</c:when>
        </c:choose>
      </p>
      <p><span>Prénom :</span> <c:out value="${user.firstName}"/></p>
      <p><span>Nom :</span> <c:out value="${user.lastName}"/></p>
      <p><span>Date de naissance :</span> <c:out value="${user.birthDateFormatted}"/></p>
      <p><span>Login :</span> <c:out value="${user.login}"/></p>
      <p><span>Adresse IP :</span> <c:out value="${user.ip}"/></p>
    </div>
    <div>
      <h3>Coordonnées</h3>
      <p><span>Adresse :</span></p>
      <ul>
        <li>
          <c:out value="${user.address0}"/>
        </li>
        <li>
          <c:out value="${user.address1}"/>
        </li>
        <li>
          <c:out value="${user.address2}"/>
        </li>
      </ul>
      <p><span>Code Postal :</span> <c:out value="${user.zipCode}"/></p>
      <p><span>Ville :</span> <c:out value="${user.city}"/></p>
      <p><span>Pays :</span> <c:out value="${user.country}"/></p>
      <p><span>Téléphone fixe :</span> <c:out value="${user.phoneHome}"/></p>
      <p><span>Téléphone portable :</span> <c:out value="${user.phoneGsm}"/></p>
      <p><span>Email :</span> <c:out value="${user.email}"/></p>
    </div>
    <div id="info-bank">
      <h3>Informations bancaires</h3>
      <p class="hidden"><c:out value="${pm.id}"/></p>
      <p class="hidden"><c:out value="${pm.status}"/></p>
      <p><span>Balance du compte :</span> <c:out value="${user.balance}"/></p>
      <p><span>Type de carte :</span> <c:out value="${pm.name}"/></p>
      <p><span>Date de création :</span> <c:out value="${pm.creationTime}"/></p>
      <p><span>Numéro de carte :</span> <c:out value="${pm.cardNumber}"/></p>
      <p><span>Date d'expiration :</span> <c:out value="${pm.cardExpirationDate}"/></p>
      <p><span>Nom du détenteur de la carte :</span> <c:out value="${pm.cardName}"/></p>
      <p><span>Crytogramme :</span> <c:out value="${pm.cardCryptogram}"/></p>
      <p id="payment-status">
        <c:choose>
          <c:when test="${pm.status == 0}">
            Le moyen de paiement est refusé.
          </c:when>
          <c:when test="${pm.status == 1}">
            Le moyen de paiement n'est pas activé.
          </c:when>
          <c:when test="${pm.status == 2}">
            Le moyen de paiement est en cours de vérification.
          </c:when>
          <c:when test="${pm.status == 3}">
            Le moyen de paiement est activé.
          </c:when>
        </c:choose>
      </p>
      <c:choose>
        <c:when test="${pm.status == 1}">
          <div id="payment-refuse" class="submit-button prev">
            <div class="top"></div>
            <div class="content">Refuser</div>
          </div>
          <div id="payment-next" class="submit-button next">
            <div class="top"></div>
            <div class="content">Vérification</div>
          </div>
        </c:when>
        <c:when test="${pm.status == 2}">
          <div id="payment-refuse" class="submit-button prev">
            <div class="top"></div>
            <div class="content">Refuser</div>
          </div>
          <div id="payment-next" class="submit-button next">
            <div class="top"></div>
            <div class="content">Validation</div>
          </div>
        </c:when>
        <c:when test="${pm.status == 3}">
          <div id="payment-refuse" class="submit-button prev">
            <div class="top"></div>
            <div class="content">Refuser</div>
          </div>
        </c:when>
      </c:choose>
    </div>
    <div id="infos-compte"">
         <h3>Informations sur le compte</h3>
      <p><span>Email :</span> <c:out value="${user.email}"/></p>
      <p><span>Date de création :</span> <c:out value="${user.creationTimeFormatted}"/></p>
      <p><span>Date de dernière modification :</span> <c:out value="${user.lastModificationFormatted}"/></p>
      <p><span>Date de dernière connexion :</span> <c:out value="${user.lastConnectionFormatted}"/></p>
      <p>
        <c:choose>
          <c:when test="${user.acceptNewsletterSite}"><span>Newsletter du site :</span> Acceptée</c:when>
          <c:otherwise><span>Newsletter du site :</span> Refusée</c:otherwise>
        </c:choose>
      </p>
      <p>
        <c:choose>
          <c:when test="${user.acceptNewsletterPartners}"><span>Newsletter des partenaires :</span> Acceptée</c:when>
          <c:otherwise><span>Newsletter des partenaires :</span> Refusée</c:otherwise>
        </c:choose>
      </p>
      <p><span>Statut du compte :</span> </p>
      <div class="light
           <c:choose>
             <c:when test="${user.status == 0}">red</c:when>
             <c:when test="${user.status == 1}">orange</c:when>
             <c:when test="${user.status == 2}">green</c:when>
           </c:choose>">
        <img alt="light" src="/img/adm/light.png"/>
      </div>
      <p>
        <c:choose>
          <c:when test="${user.status == 0}">Banni</c:when>
          <c:when test="${user.status == 1}">En attente de confirmation</c:when>
          <c:when test="${user.status == 2}">Confirmé</c:when>
        </c:choose>
      </p>
    </div>
  </div>
</div>